Copyright: DDtp Copyright DameWare Development 1998
Citation: DameWare Development 1998


 DDtp Help Index

Properties	Methods	Events

DDtp Custom Control

Description:

DameWare Date and Time Picker ActiveX component is a 32-bit custom control for use with Visual Basic, Visual C++, Windows Scripting Host and Web pages or any environment that can host ActiveX controls.  DameWare DDtp control will allow the developer to display a nifty graphic pop-up calendar for the user to select a date entry.  DDtp is completely customizable, allowing the developer to select colors for the background, text and title areas of the pop-up calendar; font selection and sizing, as well as several properties for the date display style and date format.  The date can be set as a default for the user, as well as retrieved after the user picks the date needed.

The DameWare DDtp ActiveX control utilizes the ActiveX Template Library (ATL), which reduces dependencies on other library files.  Additional information on the ATL is available on our web site at: http://www.dameware.com/faq.htm

Date and Time Picker control styles

Registration:

How to register

What do I get when I register

License

Copyright

Installation and Support:

Installation

Technical Support

Using within a Web page


Date and Time Picker control styles.
Date and Time Picker control styles

The following window styles are specific to date and time picker (DTP) controls:

DTS_APPCANPARSE

Allows the owner to parse user input and take necessary action. It enables users to edit within the client area of the control when they press the F2 key. The control sends DTN_USERSTRING notification messages when users are finished.

DTS_LONGDATEFORMAT

Displays the date in long format. The default format string for this style is defined by LOCALE_SLONGDATEFORMAT, which produces output like "Friday, April 19, 1996".

************ NOT IMPLEMENTED

DTS_RIGHTALIGN

The drop-down month calendar will be right-aligned with the control instead of left-aligned, which is the default.

************ NOT IMPLEMENTED

DTS_SHOWNONE

It is possible to have no date currently selected in the control. With this style, the control displays a check box that users can check once they have entered or selected a date. Until this check box is checked, the application will not be able to retrieve the date from the control because, in essence, the control has no date.  This state can be set with the DTM_SETSYSTEMTIME message or verified with the DTM_GETSYSTEMTIME message.

DTS_SHORTDATEFORMAT

Displays the date in short format. The default format string for this style is defined by LOCALE_SSHORTDATE, which produces output like "4/19/96".

DTS_TIMEFORMAT

Displays the time. The default format string for this style is defined by LOCALE_STIMEFORMAT, which produces output like "5:31:42 PM".

DTS_UPDOWN

Appears to the right of the DTP control to modify date values.  This style can be used instead of the drop-down month calendar, which is the default style.


Technical Support

Technical Support is provided in any of the following ways for your convenience:

•  If possible, we prefer that you use e-mail to communicate with us. Because we check e-mail many times daily (most often via our support@dameware.com account), you can be sure we will be able to respond to you quickly.

•  Online FAQ is available at http://www.dameware.com/faq.htm.

•  Online discussion group can be viewed at http://www.dameware.com/discuss.htm.

•  You can fax us at 504-626-1189.

•  You can contact us by phone at 504-626-7545 (recommended to be used as a last resort)

DAMEWARE DEVELOPMENT

1024 Live Oak Loop

Mandeville, La.  70448


How to register
How To Order

For added convenience, you may order DDtp in any of the following ways:

♦	Visit our Web Site at http://www.dameware.com/northstar.htm to order online with your Visa, MasterCard or Discover credit card, fax your order, or order by telephone:

Online at http://www.dameware.com/northstar.htm
Faxed Orders at 1-785-539-3743
Phoned Orders  calls taken 10am - 8pm, EST, Monday-Friday
     1-800-699-6395 (From the USA only)
     1-785-539-3731

Be sure to reference product number #2625 when ordering from NorthStar.

Note: Any product or support questions should be sent to support@dameware.com.  NorthStar solutions is a purchase vendor only, for DameWare Development, and unable to answer any questions about our products!

♦	For quantity pricing, please contact DameWare Development at sales@dameware.com.

♦	If you prefer to pay by check, or money order please send order information to:

DAMEWARE DEVELOPMENT

1024 Live Oak Loop

Mandeville, LA.  70448

♦	For payment by purchase order please send order information to address below, or fax to 504-626-1189:

DAMEWARE DEVELOPMENT

1024 Live Oak Loop

Mandeville, LA.  70448

Note: NorthStar Solutions does NOT accept purchase orders.


What do I get when I register
What do I get when I order

There are no limitations in this shareware release, but you may encounter a "nag" screen from time to time.  Upon receipt of your order you will receive a license file which will remove the "nag" screen. The product will be registered in your name and you will receive the latest version.  It's a small price to pay for your peace of mind. You may also wish to check on our Web Home Page for the latest version which you have rights to use as a registered user.  Our Web Home Page address is:  http://www.dameware.com.


License Agreement

DDtp is not public domain or free software.

DDtp is copyrighted, and all rights are reserved by DameWare Development.

Licensing:

1. shareware version

You may use the shareware version of DDtp for up to 30 days in your design environment for evaluation purposes only. You may copy and distribute it freely as long as all the files in the package, including the demo programs are distributed with it and no changes or additions of any kind are made to the original package.

2. registered version

As a registered user, you can use DDtp in your design environment and you have a royalty-free right to distribute executables that use DDtp as a runtime component. Only registered users can distribute executables using DDtp.

You may copy the software to facilitate your use of it on as many computers as there are licensed users specified in the license file. Making copies for any other purpose violates international copyright laws. In particular, you are prohibited from distributing a registered version of DDtp, except as a runtime component of one of your applications.

The license file allows you to compile your applications with DDtp. You are not allowed to distribute the DDtp.LIC or DDtp.LPK license files with any application that you distribute.  You are allowed to distribute the DDtpR.LIC with your Windows Scripting Host script(s).

Disclaimer of Warranty:

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS"  WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it.

The user must assume the entire risk of using the program.

Your use of this product indicates that you have read and agreed to these terms.


Installation

DameWare DDtp is distributed with a self-extracting installation wizard file - DDtpW.exe.  Once executed, DDtpW.exe will install the DDtp components into a directory of your choosing (c:\Program Files\DameWare\DDtp\ by default), and register the DDtp.dll component into the Windows system registry.

The following is a list of the files installed during the installation wizard process:

DDtp.DLL	32-bit Active DLL Component

DDtp.HLP	On-line documentation

DDtp.CNT	Contents file for On-line documentation

DDtp.HTM	DDtp Web page sample

DDtp.EXE	DDtp VB sample executable

DDtp.FRM	DDtp VB sample form

DDtpBind5.EXE	DDtp data binding VB sample executable

DDtpBind5.FRM	DDtp data binding VB sample form

DDtpBind5.VBP	DDtp data binding VB sample project file

Bind.MDB	DDtp data binding Access database sample file

DDtp.VBP	DDtp VB sample project file

Once you have registered the DDtp component, you will receive the following license files:

DDtp.LIC	License file

DDtp.LPK	License file for web pages

DDtpR.LIC	License file for Windows Scripting Host

Distribution Note:

When you create and distribute applications that use DDtp, you can install the appropriate file in the customer's Microsoft Windows \SYSTEM subdirectory, or any specific directory as long as the component is registered to that subdirectory.

Note: You are not allowed to distribute the DDtp.LIC or DDtp.LPK license files with any application that you distribute.  You are allowed to distribute the DDtpR.LIC file with your Windows Scripting Host script(s).

Dependancies:  The month calendar control is implemented in version 4.70 and later of Comctl32.dll.


Using within a Web page.
Using in a Web page

DDtp Active control can easily be used in a Web Page.  The following is a simple example.  You may also wish to visit sites such as Microsoft at (http://www.microsoft.com/workshop) or DameWare Development’s home page at (http://www.dameware.com).

<html>

<head>

<title>DDtp</title>

<big><strong><em>DDtp</em></strong></big>

<p align="CENTER">

<OBJECT ID="DDtp" CLASSID="CLSID:35020238-5912-11D1-9A00-00C04FD8DC2E"

codebase="ddtp.dll#Version=1,4,2,6" WIDTH=250 HEIGHT=30 >

<PARAM NAME="CalBackGroundColor" value="&HFFFFFF">

<PARAM NAME="CalTextColor" value="&H0">

<PARAM NAME="CalTitleBkColor" value="&H800000">

<PARAM NAME="CalTitleTextColor" value="&HFFFFFF">

<PARAM NAME="CalTrailingTextColor" value="&H808080">

</OBJECT>

<p align="CENTER"><p><input type="TEXT" value="Selected Date/Time" name="Return" size="30">

<script language="VBSCRIPT">

Sub DDTP_DateChange(d)

Return.Value = d

End Sub

</script> </p>

</html>


Displays appropriate Copyright notices
Copyright

Copyright© 1998 DameWare Development

Portions of this product are Copyrighted (c) 1991-1998 by Microsoft Corporation.

All rights are reserved. All  Microsoft Corporation disclaimers apply.

DDtp is a trademark of DameWare Development.

Microsoft Windows is a registered trademark of Microsoft Corporation.

Microsoft Windows Scripting Host is a registered trademark of Microsoft Corporation.


Displays Properties
Properties

All the properties are listed below. Properties that apply only to

DDtp, or require special consideration when used with it,

are underlined. They are documented in this help file. See the

Visual Basic Language Reference or online Help for

documentation of the remaining properties.

(About)	(Custom)
Name	CalBackGroundColor
CalTextColor	CalTitleBkColor
CalTitleTextColor	CalTrailingTextColor
DataBindings	DataField
DataSource	DateDisplayFormat
DateTimeStyle	dDate
DragIcon	DragMode
Enabled	Font
Height	HelpContextID
TabIndex	Index
Left	TabIndex
TabStop	Tag
ToolTipText	Top
UseCustomDateFormat	Visible
WhatsThisHelpID	Width


Display the DDtp About box
(About) Property

Properties	Methods	Events

Description

The (About) property will invoke the DameWare DDtp About box dialog.  This dialog is used to display the control’s registration information.

Syntax

DDTPCtl1.AboutBox

Notes

The About box dialog will be displayed in the Windows environment until the control is registered with the license file (DDtp.lic), or the Web environment with the license file (DDtp.lpk).


(Custom) Properties Pages dialog box.
(Custom) Property

Properties	Methods	Events

Description

The (Custom) property will load the Properties Pages dialog box.  This dialog is used to display the different properties available to customize for DDtp, including custom date formats, various color properties and fonts.

Syntax

DDTPCtl1.Properties

See Also

CalBackGroundColor

CalTextColor

CalTitleBkColor

CalTitleTextColor

CalTrailingTextColor

DateDisplayFormat

DateTimeStyle


Specify calendar background color.
CalBackGroundColor Property

Properties	Methods	Events

Description

Specifies the background color of the drop down calendar when the Date Display Style is set to the short, long or time format.

Syntax

DDTPCtl1.CalBackGroundColor = &HFF&

Data Type

String

Example

Private Sub Form_Load()

DDTPCtl1.CalBackGroundColor = &HFF0000

End Sub

See Also

CalTextColor

CalTitleBkColor

CalTitleTextColor

CalTrailingTextColor


Specify calendar text color.
CalTextColor Property

Properties	Methods	Events

Description

Specifies the text color of the drop down calendar when the Date Display Style is set to the short, long or time format.

Syntax

DDTPCtl1.CalTextColor = &HFFFF

Data Type

String

Example

Private Sub Form_Load()

DDTPCtl1.CalTextColor = &HFFFF

End Sub

See Also

CalBackGroundColor

CalTitleBkColor

CalTitleTextColor

CalTrailingTextColor


Specify calendar title background color.
CalTitleBkColor Property

Properties	Methods	Events

Description

Specifies the background color of the title of the drop down calendar when the Date Display Style is set to the short, long or time format.

Syntax

DDTPCtl1.CalTitleBkColor = &HFFFF00

Data Type

String

Example

Private Sub Form_Load()

DDTPCtl1.CalTitleBkColor = &HFFFF00

End Sub

See Also

CalBackGroundColor

CalTextColor

CalTitleTextColor

CalTrailingTextColor


Specify calendar title text color.
CalTitleTextColor Property

Properties	Methods	Events

Description

Specifies the text color of the title of the drop down calendar when the Date Display Style is set to the short, long or time format.

Syntax

DDTPCtl1.CalTitleTextColor = &HFF00FF

Data Type

String

Example

Private Sub Form_Load()

DDTPCtl1.CalTitleTextColor = &HFF00FF

End Sub

See Also

CalBackGroundColor

CalTextColor

CalTitleBkColor

CalTrailingTextColor


Specify calendar trailing color.
CalTrailingTextColor Property

Properties	Methods	Events

Description

Specifies the text color of the text before and after the current month’s days of the drop down calendar when the Date Display Style is set to the short, long or time format.

Syntax

DDTPCtl1.CalTrailingTextColor = &HC0

Data Type

String

Example

Private Sub Form_Load()

DDTPCtl1.CalTrailingTextColor = &HC0

End Sub

See Also

CalBackGroundColor

CalTextColor

CalTitleBkColor

CalTitleTextColor


Return or set a databindings collection object that collects the bindable properties available to the developer.
DataBindings Property

Properties	Methods	Events

Description

Returns/sets a DataBindings collection object that collects the bindable properties that are available to the developer.  From within the VB development environment, selection of this property will display a dialog box that contains a combo box displaying the properties available within the control for databinding.  DDtp contains one bindable property - dDate.

See Also

DataField

DataSource


Returns or sets a value that binds a control to a field in the current record.
DataField Property

Properties	Methods	Events

Description

Returns/sets a value that binds a control to a field in the current record of the data base.

See Also

DataBindings

DataSource


Sets a value that specifies the Data control through which the current control is bound to a database.
DataSource Property

Properties	Methods	Events

Description

Sets a value that specifies the Data control through which the current control is bound to a database.

See Also

DataBindings

DataField


Specify format of the date string to display.
DateDisplayFormat Property

Properties	Methods	Events

Description

Specifies the format of the date string to display when the UseCustomDateFormat is selected. The valid format characters are listed below in the Notes.

Syntax

DDTPCtl1.DateDisplayFormat = "dddd', 'MMMM d', 'yyy"

Data Type

String

Notes

Formatting:

It is acceptable to include extra characters within the format string to produce a more rich display. However, any nonformat characters must be enclosed within single quotes.

For example, the format string "'Today is: 'hh':'m':'s ddddMMMdd', 'yyy" would produce output like "Today is: 04:22:31 Tuesday Mar 23, 1996".

Date and time picker (DTP) controls support the following format characters.

String Fragment Description

"d"  The one- or two-digit day.

"dd"  The two-digit day. Single-digit day values are preceded by a zero.

"ddd"  The three-character weekday abbreviation.

"dddd"  The full weekday name.

"h"  The one- or two-digit hour in 12-hour format.

"hh"  The two-digit hour in 12-hour format. Single-digit values are

  preceded by a zero.

"H"  The one- or two-digit hour in 24-hour format.

"HH"  The two-digit hour in 24-hour format. Single-digit values are

  preceded by a zero.

"m"  The one- or two-digit minute.

"mm"  The two-digit minute. Single-digit values are preceded by a zero.

"M"  The one- or two-digit month number.

"MM"  The two-digit month number. Single-digit values are preceded by a zero.

"MMM"  The three-character month abbreviation.

"MMMM"  The full month name.

"t"  The one-letter AM/PM abbreviation (that is, AM is displayed as "A").

"tt"  The two-letter AM/PM abbreviation (that is, AM is displayed as "AM").

************ NOT IMPLEMENTED

"X"  The callback field. The control still uses the other valid format

 characters and queries the owner to fill in the "X" portion.

 So the owner must be prepared to handle the DTN_WMKEYDOWN,

 DTN_FORMAT, and DTN_FORMATQUERY notification messages.

 Multiple "X" characters can be used in series to signify unique

 callback fields.

"y"  The one-digit year (that is, 1996 would be displayed as "6").

"yy"  The last two digits of the year (that is, 1996 would be displayed as "96").

"yyy"  The full year (that is, 1996 would be displayed as "1996").

Example

Private Sub Form_Load()

DDTPCtl1.DateDisplayFormat = "dddd', 'MMMM d', 'yyy"

End Sub

See Also

DateTimeStyle

UseCustomDateFormat


Specify the font characteristics of the text displayed in the drop down calendar.
DateTimeStyle Property

Properties	Methods	Events

Description

Specifies the Date Display Style returned by the DDtp control.

Syntax

DDTPCtl1.DateTimeStyle = 2

Data Type

Integer

Notes

The valid choices for DateTimeStyle are:

0 Use Up/Down instead of month calendar - when selected this option will display up/down scroll bars instead of a down arrow and will display the date in the long date format.

1 Use the short date format - when selected this option will display the down arrow for user selection to bring up the drop down calendar in short date format.

2 Use the long date format - when selected this option will display the down arrow for user selection to bring up the drop down calendar in long date format.

3 Use the time format - when selected this option will display the down arrow for user selection to bring up the drop down calendar in time format.

Formats:

short date	12/25/96

long date	Wednesday, December 25, 1996

time	11:44:45 AM

Example

Private Sub Form_Load()

DDTPCtl1.DateTimeStyle = 2

End Sub

See Also

UseCustomDateFormat

(Custom)


Specify the default date.
dDate Property

Properties	Methods	Events

Description

Specifies the default date when the control is loaded.  When not specified, current date is the default.

Syntax

DDTPCtl1.dDate = "08/14/2010"

Data Type

Date Object

Example

Private Sub Form_Load()

DDTPCtl1.dDate = "08/14/2010"

End Sub


Enable or disable the component.
Enabled Property

Properties	Methods	Events

Description

Enable or disable the component.  This will allow the developer to ‘gray-out’ the component, so the user cannot use it.

Syntax

DDTPCtl1.Enabled = False

DDTPCtl1.Enabled = True (default)

Data Type

Boolean

Example

Private Sub Form_Load()

DDTPCtl1.Enabled = False

End Sub


Activate the use of custom date formats.
UseCustomDateFormat Property

Properties	Methods	Events

Description

Activates or de-activates the use of custom date formats within the control.

Syntax

DDTPCtl1.UseCustomDateFormat = 1

Data Type

Integer

Example

Private Sub Form_Load()

DDTPCtl1.UseCustomDateFormat = 0

End Sub

See Also

DateTimeStyle


Displays Methods
Methods

All of the methods are listed below. Methods that apply only to

DDtp, or require special consideration when used

with it, are underlined. They are documented in this help file.

See the Visual Basic Language Reference or online Help for

documentation of the remaining events.

GetDate

SetDate


Retrieve the date that the user has currently selected.
GetDate Method

Properties	Methods	Events

Description

Retrieve the date that the user has currently selected.

Syntax

mydate = DDTPCtl1.GetDate

Data Type

Date

Example

Private Sub DDTPCtl1_DateChange(ByVal d As Date)

Dim mydate

mydate = DDTPCtl1.GetDate

End Sub

See Also

SetDate


Set the date to be displayed by the user.
SetDate Method

Properties	Methods	Events

Description

Set the date to be displayed by the user.

Syntax

DDTPCtl1.SetDate(newVal as Date)

Data Type

Date

Example

Private Sub DDTPCtl1_DateChange(ByVal d As Date)

Dim mydate

mydate = "8/14/55"

DDTPCtl1.SetDate (mydate)

End Sub

See Also

GetDate


Displays Events
Events

All the events are listed below. Events that apply only to

DDtp, or require special consideration when used

with it, are underlined. They are documented in this help file.

See the Visual Basic Language Reference or online Help for

documentation of the remaining events.

DateChange

DragDrop

DragOver

GotFocus

LostFocus


Trap the changed date selected by the user.
DateChange Event

Properties	Methods	Events

Description

Trap the date when changed by the user.

Syntax

Text1.Text = d

Data Type

String

Example

Private Sub DDTPCtl1_DateChange(ByVal d As Date)

Text1.Text = d

End Sub